package com.example.demo.service.impl;

import com.example.demo.domain.Employee;
import com.example.demo.domain.Vo.EmployeeVo;
import com.example.demo.mapper.EmployeeMapper;
import com.example.demo.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements IEmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    /**
     * 查询员工
     * @param employee
     * @return
     */
    @Override
    public List<EmployeeVo> selectEmployee(Employee employee){return employeeMapper.selectEmployee(employee);}

    /**
     * 新增员工
     * @param employee
     */

    @Override
    public void insertEmployee(Employee employee){
        employeeMapper.insertEmployee(employee);
    }

    /**
     * 修改员工
     * @param employee
     */
    @Override
    public void updateEmployeeById(Employee employee) { employeeMapper.updateEmployeeById(employee);}


    /**
     * 删除员工
     * @param employeeId
     */
    @Override
    public void delEmployeeById(long employeeId) {
        employeeMapper.delEmployeeById(employeeId);
    }
}
